
<template>
	<view>
		<view class="content">
			<view class="left">
				<image :src="item.image" mode=""></image>
			</view>
			<view class="right">
				<view class="con-title">{{ item.title }}</view>
				<view class="desc">{{ item.desc }}</view>
				<view class="price">{{ item.price }}</view>
			</view>
		</view>
		<uni-goods-nav :fill="true"  :options="options" :buttonGroup="buttonGroup"  @click="onClick" @buttonClick="buttonClick" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				item: {},
				options: [{
							icon: 'headphones',
							text: '客服'
						}, {
							icon: 'shop',
							text: '店铺',
							info: 2,
							infoBackgroundColor:'#007aff',
							infoColor:"red"
						}, {
							icon: 'cart',
							text: '购物车',
							info: 2
						}],
					    buttonGroup: [{
					      text: '加入购物车',
					      backgroundColor: '#ff0000',
					      color: '#fff'
					    },
					    {
					      text: '立即购买',
					      backgroundColor: '#ffa200',
					      color: '#fff'
					    }
					    ]
			};
		},
		onLoad(options) {
			this.item = options
		},
		methods: {
			  onClick (e) {
			    uni.showToast({
			      title: `点击${e.content.text}`,
			      icon: 'none'
			    })
			  },
			  buttonClick (e) {
			    console.log(e)
			    this.options[2].info++
			  }
			}
	}
</script>

<style lang="scss" scoped>
image {
	width: 100%
}
</style>
